package com.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bean.Goods;
import com.bean.User;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author WxrStart
 * @create 2022-06-14 14:40
 */
@Repository
public interface GoodsMapper extends BaseMapper<Goods> {
    int updateGoodsDynamic(Goods goods);

    /**
     * 通过orderId查找商品是否是当前商品)
     * @param orderId
     * @return
     */
    Goods getGoodsByOrderId(Integer orderId);



    /**
     * 只能购买不是秒杀的商品
     */
    @Select("SELECT * FROM goods WHERE is_seckill = 0")
    List<Goods> getGoodsList();

}
